function result = countAvgTaskTimes(fileName)

%	static const int STOP 		= 1000;
%	static const int SHOOT 		= 1001;
%	static const int PROTECT_GOAL	= 1002;
%	static const int CAPTURE_BALL	= 1003;
%	static const int PASS_THE_BALL	= 1004;
%	static const int WAIT_FOR_PASS	= 1005;
%	static const int HOLD_POSITION 	= 1006;
%	static const int COVER		= 1007;

baseStruct		   =  struct("STOP",[],
	                                       "SHOOT",[],
	                                       "PROTECT_GOAL",[],
	                                       "CAPTURE_BALL",[],
	                                       "PASS_THE_BALL",[],
	                                       "WAIT_FOR_PASS",[],
	                                       "HOLD_POSITION",[],
	                                       "COVER",[]);	                                       
COLUMN_TASK_ID = 11 ;                        


result = baseStruct;	                                       
rawData = load ('-ascii',fileName);

taskIds = rawData(:,COLUMN_TASK_ID);
totalRows = rows(taskIds);

pass_the_ball_count = sum(taskIds == 1004);

prevTaskId = 0;
taskRows = 0;
for i = 1:totalRows
	if prevTaskId != taskIds(i)
		prevTaskId = taskIds(i);
		switch prevTaskId
			case 1000 %stop
				result.STOP = [result.STOP, taskRows];
			case 1001
				result.SHOOT = [result.SHOOT, taskRows];
			case 1002
				result.PROTECT_GOAL = [result.PROTECT_GOAL, taskRows];
			case 1003
				result.CAPTURE_BALL = [result.CAPTURE_BALL, taskRows];
			case 1004
				result.PASS_THE_BALL = [result.PASS_THE_BALL, taskRows];
			case 1005
				result.WAIT_FOR_PASS = [result.WAIT_FOR_PASS, taskRows];
			case 1006
				result.HOLD_POSITION = [result.HOLD_POSITION, taskRows];		
			case 1007
				result.COVER = [result.COVER, taskRows];			
		endswitch
		taskRows = 0;
	endif
	
	taskRows  = taskRows + 1;
endfor	                                       

for [val,key] = result
	if length(val) == 0
		result.(key) = 0;
	else
		result.(key) = mean(val) / totalRows;
	endif
endfor

result;

endfunction